package org.tp8.sampleapp.view.converter;

import javax.faces.convert.Converter;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * The Class AbstractConverter.
 */
public abstract class AbstractConverter implements Converter,
		ApplicationContextAware {

	/**
	 * The application context.
	 */
	private static ApplicationContext applicationContext;

	/**
	 * Gets the application context.
	 * 
	 * @return the application context
	 */
	public static ApplicationContext getApplicationContext() {
		return applicationContext;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.springframework.context.ApplicationContextAware#setApplicationContext
	 * (org.springframework.context.ApplicationContext)
	 */
	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		applicationContext = arg0;
	}

}
